/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sunsite.tools;

import javax.servlet.http.*;
/**
 *
 * @author Administrator
 */
public class Path {

    /**
     * 获得程序根目录  
     * @param request
     * @return 
     */
    public static String getServerUrl(HttpServletRequest request)
    {
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
	return basePath;
    }
    
        public static String MapHeadUrl2(String headname) {
        return "../../images/heads/" + headname ;
    }
    public static String MapHeadUrl1(String headname) {
        return "../images/heads/" + headname ;
    }
}
